home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWSemEvt / Include / FWScpPrp.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  3.8 KB  |  144 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWScpPrp.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    © 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWSCPPRP_H
  11. #define FWSCPPRP_H
  12.  
  13. #ifndef FWDESC_H
  14. #include "FWDesc.h"
  15. #endif
  16.  
  17. #ifndef FWSCPTBL_H
  18. #include "FWScptbl.h"
  19. #endif
  20.  
  21. #ifndef FWMREFCT_H
  22. #include "FWMRefCt.h"
  23. #endif
  24.  
  25. //========================================================================================
  26. //    Forward Declarations
  27. //========================================================================================
  28.  
  29. class FW_MScriptable;
  30.  
  31. //========================================================================================
  32. //    class FW_CPropertyDesignator
  33. //========================================================================================
  34.  
  35. class FW_CPropertyDesignator : public FW_MScriptable
  36. {
  37. public:
  38.     FW_DECLARE_CLASS
  39.     FW_DECLARE_AUTO(FW_CPropertyDesignator)
  40.     
  41.     FW_CPropertyDesignator(FW_CPart* part, FW_MScriptable* whichObject, ODDescType whichProperty);
  42.     
  43.     virtual ~FW_CPropertyDesignator();
  44.  
  45.     virtual ODDescType GetObjectClass() const;
  46.     
  47.     virtual ODDescType    GetTokenType() const;
  48.  
  49.     virtual ODDescType GetSpecifierForm() const;
  50.     
  51.     // ----- Reference Counting -----
  52.  
  53.     virtual long AcquireScriptable();
  54.     
  55.     virtual long ReleaseScriptable();
  56.  
  57.     // ----- FW_MScriptable Methods -----
  58.     
  59.     virtual FW_Boolean    CompareScriptableObjects(Environment* ev,
  60.                                                 FW_CPart* part,
  61.                                                 ODDescType operation,
  62.                                                 const FW_CDesc& other) const;
  63.  
  64.     virtual void         BuildObjectSpecifier(Environment* ev,
  65.                                             FW_CPart* part,
  66.                                             const FW_CFrame* frame,
  67.                                             FW_CDesc& specifier,
  68.                                             ODDescType preferredForm) const;
  69.     // ----- Core Events -----
  70.  
  71.     virtual void        DoAEGetData(Environment* ev,
  72.                                     FW_CPart* part,
  73.                                     const FW_CAppleEvent& event,
  74.                                     FW_CAppleEvent& reply);
  75.  
  76.     virtual void        DoAESetData(Environment* ev,
  77.                                     FW_CPart* part,
  78.                                     const FW_CAppleEvent& event,
  79.                                     FW_CAppleEvent& reply);
  80.  
  81.     // ----- Token Type -----
  82.  
  83.     
  84.     // ----- Designate Access -----
  85.  
  86.     void                GetDesignateValue(Environment* ev, FW_CDesc& propertyValue) const;
  87.     void                SetDesignateValue(Environment* ev, FW_CDesc& propertyValue);
  88.     void                RestoreDesignateValue(Environment* ev, FW_CDesc& propertyValue);
  89.     
  90.     FW_CFrame*            GetDesignateFrame(Environment* ev, FW_CPart* part);
  91.     void                GetDesignateInfo(Environment* ev,
  92.                                         FW_Boolean& canUndo, 
  93.                                         FW_Boolean& causesChange);
  94.                                         
  95.     void                GetDesignateUndoStrings(Environment* ev, 
  96.                                                 FW_CPart* part,
  97.                                                 FW_CString& undoString, 
  98.                                                 FW_CString& redoString);
  99.         
  100.     // ----- Dependencies -----
  101.     
  102.     virtual void        HandlePrimaryDeleted(FW_MScriptable* primary);
  103.  
  104.     // ----- Data Access -----
  105.     
  106.     inline FW_MScriptable*     GetSemanticObject() const { return fObject; }
  107.     
  108. private:
  109.     FW_MScriptable*        fObject;
  110.     FW_CPart*            fPart;
  111.     ODDescType            fWhichProperty;
  112.     
  113.     long                fRefCount;
  114. };
  115.  
  116. //========================================================================================
  117. //    class FW_CSetPropertyCommand
  118. //========================================================================================
  119.  
  120. class FW_CSetPropertyCommand : public FW_CCommand
  121. {
  122. public:
  123.     FW_DECLARE_AUTO(FW_CSetPropertyCommand)
  124.     
  125.     FW_CSetPropertyCommand(Environment* ev, 
  126.                         FW_CFrame* frame, 
  127.                         FW_Boolean canUndo,
  128.                         FW_CPropertyDesignator* propDesignator,
  129.                         FW_CDesc& newValue);
  130.                         
  131.     virtual ~FW_CSetPropertyCommand();
  132.     
  133.     virtual void DoIt(Environment* ev);
  134.     virtual void UndoIt(Environment* ev);
  135.     virtual void RedoIt(Environment* ev);
  136.     
  137. protected:
  138.     
  139.     FW_CPropertyDesignator* fPropDesignator;
  140.     FW_CDesc                 fOldValue;
  141.     FW_CDesc                fNewValue;
  142. };
  143.  
  144. #endif // FWSCPPRP_H